# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Manufacturers.V1.Model.ProductCertification do
  @moduledoc """
  Product certification data.

  ## Attributes

  *   `brand` (*type:* `String.t`, *default:* `nil`) - Required. This is the product's brand name. The brand is used to help identify your product.
  *   `certification` (*type:* `list(GoogleApi.Manufacturers.V1.Model.Certification.t)`, *default:* `nil`) - Required. A list of certifications to link to the described product.
  *   `countryCode` (*type:* `list(String.t)`, *default:* `nil`) - Optional. A 2-letter country code (ISO 3166-1 Alpha 2).
  *   `destinationStatuses` (*type:* `list(GoogleApi.Manufacturers.V1.Model.DestinationStatus.t)`, *default:* `nil`) - Output only. The statuses of the destinations.
  *   `issues` (*type:* `list(GoogleApi.Manufacturers.V1.Model.Issue.t)`, *default:* `nil`) - Output only. A server-generated list of issues associated with the product.
  *   `mpn` (*type:* `list(String.t)`, *default:* `nil`) - Optional. These are the Manufacturer Part Numbers (MPN). MPNs are used to uniquely identify a specific product among all products from the same manufacturer
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. The unique name identifier of a product certification Format: accounts/{account}/languages/{language_code}/productCertifications/{id} Where `id` is a some unique identifier and `language_code` is a 2-letter ISO 639-1 code of a Shopping supported language according to https://support.google.com/merchants/answer/160637.
  *   `productCode` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Another name for GTIN.
  *   `productType` (*type:* `list(String.t)`, *default:* `nil`) - Optional. These are your own product categorization system in your product data.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Required. This is to clearly identify the product you are certifying.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :brand => String.t() | nil,
          :certification => list(GoogleApi.Manufacturers.V1.Model.Certification.t()) | nil,
          :countryCode => list(String.t()) | nil,
          :destinationStatuses =>
            list(GoogleApi.Manufacturers.V1.Model.DestinationStatus.t()) | nil,
          :issues => list(GoogleApi.Manufacturers.V1.Model.Issue.t()) | nil,
          :mpn => list(String.t()) | nil,
          :name => String.t() | nil,
          :productCode => list(String.t()) | nil,
          :productType => list(String.t()) | nil,
          :title => String.t() | nil
        }

  field(:brand)
  field(:certification, as: GoogleApi.Manufacturers.V1.Model.Certification, type: :list)
  field(:countryCode, type: :list)
  field(:destinationStatuses, as: GoogleApi.Manufacturers.V1.Model.DestinationStatus, type: :list)
  field(:issues, as: GoogleApi.Manufacturers.V1.Model.Issue, type: :list)
  field(:mpn, type: :list)
  field(:name)
  field(:productCode, type: :list)
  field(:productType, type: :list)
  field(:title)
end

defimpl Poison.Decoder, for: GoogleApi.Manufacturers.V1.Model.ProductCertification do
  def decode(value, options) do
    GoogleApi.Manufacturers.V1.Model.ProductCertification.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Manufacturers.V1.Model.ProductCertification do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
